import Vue from 'vue'
import vuex from 'vuex'
Vue.use(vuex);

const store = new vuex.Store({
  state: {
    userInfo: localStorage.userInfo && localStorage.userInfo != '' ? JSON.parse(localStorage.userInfo) : null,
    sessionId: localStorage.sessionId ? localStorage.sessionId : '',
    showBandPhone: false,
    isShowAccount: false,
    isBind: true,
    creatData:null,
    isBuy:false
  },
  mutations: {
    userInfo(state, info) {
      localStorage.userInfo = JSON.stringify(info)
      state.userInfo = info;
    },
    sessionId(state, info) {
      localStorage.sessionId = info
      state.sessionId = info;
    },
    showBandPhone(state, info){
      state.showBandPhone = info
    },
    isShowAccount(state, info){
      state.isShowAccount = info
    },
    isBind(state, info){
      state.isBind = info
    },
    creatData(state,info){
      state.creatData = info
    },
    isBuy(state,info){
      state.isBuy = info
    }
  },
  actions: {
  },
  modules: {
  }
})

export default store
